package com.huang.day9;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService;

/**
 * @author HuangShen
 * @Description
 * @create 2021-04-11 20:01
 */
public class MyTest1 {

    public static void main(String[] args) {
        ExecutorService fixedThreadPool = Executors.newFixedThreadPool(20);
        ExecutorService cachedThreadPool = Executors.newCachedThreadPool();
        ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor();

        ScheduledExecutorService scheduledExecutorService = Executors.newScheduledThreadPool(2);

        for (int i = 0; i < 1000000; i++) {
                  int j=i;
            fixedThreadPool.execute(()->{
                System.out.println( Thread.currentThread().getName()+"执行任务"+j);
            });
        }

    }
}
